import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Register from '../views/User/Register'
import login from '../views/User/login'
import index from '../views/User/index'
import UserCenter from '../views/User/UserCenter'
import UserCenterSite from '../views/User/UserCenterSite'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/Register',
      name: 'Register',
      component: Register
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/index',
      name: 'index',
      component: index
    },
    {
      path: '/oauth/CallBack/',
      name: '/oauth/',
      component: () => import('../views/Oauth/CallBack')
    },
    {
      path: '/UserCenter',
      name: 'UserCenter',
      component: UserCenter
    },
    {
      path: '/UserCenterSite',
      name: 'UserCenterSite',
      component: UserCenterSite
    },
    {
      path: '/goods/list/',
      name: 'goods_list',
      component: () => import('@/views/Goods/GoodsList'),
    },
    {
      path: '/goods/detail/',
      name: 'goods_detail',
      component: () => import('@/views/Goods/GoodsDetail'),
    },
    {
      path: '/carts/',
      name: 'carts',
      component: () => import('@/views/Carts/Carts'),
    },
    {
      path: '/place_order/',
      name: 'place_order',
      component: () => import('@/views/Orders/PlaceOrder'),
    },
    {
      path: '/order_success/',
      name: 'place_order',
      component: () => import('@/views/Orders/OrderSuccess'),
    },
    {
      path: '/user/center/order/',
      name: 'center_order',
      component: () => import('@/views/User/UserCenterOrder'),
    },
  ],
  mode:'history'    /* 有两种模式（hash 和 history）*/
})
